package com.lzh;

import com.lzh.mapper.CTMapper;
import com.lzh.pojo.CT;
import com.lzh.pojo.Class;
import com.lzh.pojo.Teacher;
import com.lzh.service.CTService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * @author reborn
 * @create 2020/5/21-13:14
 */
@SpringBootTest
public class CTtest {
    @Autowired
    CTService ctService;
    @Autowired
    CTMapper ctMapper;

    @Test
    public void test1(){
        List<CT> cts = ctService.selectTeacherClass(1);
        cts.forEach(System.out::println);
    }

    @Test
    public void test2(){
        CT cts = ctService.selectCT(1);
        System.out.println(cts);
    }

    @Test
    public void test3(){
        CT cts = ctService.selectTeaStu(1);
        System.out.println(cts);
    }


    @Test
    public void test5(){
        List<Class> classes = ctService.selectCname(Arrays.asList(1,2));
        System.out.println(classes);
    }

    @Test
    public void test6(){
        Set<Integer> integers = ctMapper.selectTidByCid(Arrays.asList(2));
        System.out.println(integers);
    }


    @Test
    public void tes6t(){
        List<CT> cts = ctMapper.selectTeaByCid(2);
        System.out.println(cts);
    }

    @Test
    public void tes7t(){
        int i = ctMapper.addTtoC(new CT(100, 1));
        System.out.println(i);
    }

    @Test
    public void tes1t(){
        int i = ctMapper.deleteOCidByTid(new CT(2, 10));
        System.out.println(i);
    }

    @Test
    public void te2s1t(){
        List<Class> classes = ctMapper.selectClassByName("一");
        System.out.println(classes);
    }
    @Test
    public void te2s221t(){

        Teacher teacher = new Teacher();
        teacher.setLoginTime(new Date());
        System.out.println(teacher);
    }
}
